// include owr libraries
#include "../Processor/inc/Mat.h"
#include "../Processor/inc/Processor.h"
#include "../Processor/inc/FileReader.h"
#pragma comment (lib, "../Release/Processor")

#include <cmath>
#include <iostream>
using namespace std;

int main (void) {

	// create some new data
	MatrixData data;
/*	for (int i = 0; i < 10; ++i) {
		MatrixRow row;
		for (int j = 0; j < 10; ++j) {
			row.push_back (rand () % 1000);
		}
		data.push_back (row);
	}*/

	
	// create matrix from data
	IMat* first = new Mat ();
	FileReader* reader = new FileReader ();
	reader->setrFileURL("text.txt");
	first->Load(reader);
	IMat* second = new Mat (*first);

	// create filters:
	// - high filter:
	vector <MatrixValue> h;
	h.push_back (3);

	// - low filter:
	vector <MatrixValue> w;
	w.push_back (1);

	// wavelet transform
	first->matWaveletByRow (h, w);
	// output matrix before transformations and after
	unsigned int rowCount = first->GetRowCount ();
	unsigned int rowSize = first->GetRowSize ();
	for (unsigned int i = 0; i < rowCount; ++i) {
		MatrixRow row = second->GetRow (i);
		for (unsigned int j = 0; j < rowSize; ++j) {
			cout<<row.at(j)<<" ";
		}
		/*row = first->GetRow (i);
		for (unsigned int j = 0; j < rowSize; ++j) {
			cout<<row.at(j)<<" ";
		}*/
		cout<<endl;
	}
	// wait...
	system ("pause");
	
	// release resourse
	delete first;
	delete second;
	return (0);
}